﻿
using Eugenhome.Atrium.Site;
using System.IO;
using System.Collections.Generic;
using System.Linq;

namespace Eugenhome.Atrium.LibRu.Web
{
    /// <summary>
    /// 
    /// </summary>
    public class LibRuBookFile : BaseFile
    {
        /// <summary></summary>
        public const string FILEFOLDER = "Target";

        /// <summary>
        /// 
        /// </summary>
        /// <param name="fullFileName"></param>
        public LibRuBookFile(string fullFileName)
            : base(FILEFOLDER, fullFileName)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="content"></param>
        public void AddContent(string content)
        {
            string dir = Path.GetDirectoryName(this.FullFileName);
            if (!Directory.Exists(dir))
                Directory.CreateDirectory(dir);

            StreamWriter sw = new StreamWriter(this.FullFileName, true);
            sw.Write(content);
            sw.Close();
        }

    }
}